package cn.edu.lingnan.servlet.project;

import cn.edu.lingnan.pojo.Project;
import cn.edu.lingnan.service.ProjectService;
import cn.edu.lingnan.service.ProjectServiceImp;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@WebServlet("/AgreeStudentCreateProject")
public class AgreeStudentCreateProjectServlet extends HttpServlet {
    private ProjectService projectService= new ProjectServiceImp();

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Integer projectId =Integer.parseInt( request.getParameter("projectId"));

        Integer i = projectService.AgreeProject(projectId,1);
        List<Project> studnetCreateProject = projectService.QueryStudnetCreateProject();
        request.getSession().setAttribute("studnetCreateProject",studnetCreateProject);


        response.sendRedirect("manager_AudltSudentCreateProject.jsp");  // replace with your JSP page path
    }
}
